package words.parser;


public class QuestionParser {


	private String _category;
	private String _cleanQuestion;

	public QuestionParser(String question) {
		_category = "";
		_cleanQuestion = "";
		parse(question);
	}

	private void parse(String question) {
		int doublePointsIndex = question.indexOf(":");
		int spaceIndex = question.indexOf(" ");
		if(doublePointsIndex<0||spaceIndex<0) return;
		if(spaceIndex<=doublePointsIndex) return;
		
		_category = question.substring(0, doublePointsIndex);
		_cleanQuestion = question.substring(spaceIndex+1, question.length());	
	}

	public String cleanQuestion() {
		return _cleanQuestion;
	}

	public String category() {
		return _category;
	}

}
